using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using UnityEngine;

namespace Bingo.Helper
{
    public static class ColorHelper
    {
        /// <summary>
        /// 颜色转换
        /// </summary>
        /// <param name="strHex"></param>
        /// <returns></returns>
        public static Color GetColor(string strHex)
        {
            byte r = byte.Parse(strHex.Substring(0, 2), NumberStyles.HexNumber);
            byte g = byte.Parse(strHex.Substring(2, 2), NumberStyles.HexNumber);
            byte b = byte.Parse(strHex.Substring(4, 2), NumberStyles.HexNumber);

            Color c = new Color(r / 255.0f, g / 255.0f, b / 255.0f, 1);
            return c;
        }
    }
}